@extends('layouts.app')

@section('content')
    <br/>
    <div class="container">

        <div class="row">

        </div>
        <div class="row">
        <div class="panel panel-default col-md-10 col-md-offset-1">
            <div class="panel-heading" style="background-color: #fff;border-color: #fff;padding:25px 15px;">

                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a href="#avatar" aria-controls="home" role="tab" data-toggle="tab">签名头像</a></li>
                    <li role="presentation" ><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">个人资料   <span class="badge" >1</span></a></li>
                    <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">账号安全</a></li>
                    <li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">隐私设置</a></li>
                    <li role="presentation"><a href="#renzhen" aria-controls="renzhen" role="tab" data-toggle="tab">实名认证  <span class="badge" >1</span></a></li>
                </ul>
            </div>

            <div class="panel-body">
                <!-- Tab panes -->
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane  active" id="avatar">
                        <form action="{{ route('users.update', $user->id) }}" method="POST"
                              accept-charset="UTF-8"
                              enctype="multipart/form-data">
                            <div class="col-md-5 col-md-offset-1">
                                <input type="hidden" name="_method" value="PUT">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">



                                @if($user->avatar)
                                    <br>
                                    <img class="thumbnail img-responsive" src="{{ $user->avatar }}" width="200" />
                                @endif
                                <div class="form-group">
                                    <label for="" class="avatar-label">用户头像</label>
                                    <input type="file" name="avatar">
                                </div>





                            </div>
                            <div class="col-md-5 col-md-offset-0">
                                <div class="form-group">
                                    <label for="introduction-field">个人签名</label>
                                    <textarea name="introduction" id="introduction-field" class="form-control" rows="4">{{ old('introduction', $user->introduction ) }}</textarea>
                                </div>
                                <div style="height: 110px">

                                    @include('common.error')
                                </div>
                                <div class="well well-sm">
                                    <button type="submit" class="btn btn-primary ">保存</button>
                                </div>
                            </div>
                        </form>
                    </div>

                    <div role="tabpanel" class="tab-pane " id="profile">
                        <!-- 16:9 aspect ratio -->
                            <iframe  src="https://www.baidu.com" frameborder="0" width="100%"  height="100%">
                                1
                            </iframe>

                    </div>
                    <div role="tabpanel" class="tab-pane" id="messages">
                        {{--<div class="col-md-5 col-md-offset-0">--}}
                            {{--<br/>--}}
                            {{--<div class="well well-sm">--}}
                                {{--<br/>--}}
                                    {{--<h4>已绑定手机号码 15*****020,请先验证</h4>--}}
                                {{--<br/>    <br/>--}}
                                    {{--<a href="" class="btn btn-primary">发送验证码</a>--}}
                                    {{--<a href="" class="btn ">解绑</a>--}}

                            {{--</div>--}}
                        {{--</div>--}}
                        <div class="col-md-5 col-md-offset-3 ">

                            <div class="form-group">
                                <label for="name-field">用户名</label>
                                <input class="form-control " disabled type="text"   name="name" id="name-field" value="{{ old('name', $user->name ) }}" />
                            </div>

                            <div class="form-group">
                                <label for="email-field">旧密码</label>
                                <input class="form-control" type="text" name="email" id="email-field" value="{{ old('email', $user->email ) }}" />
                            </div>
                            <div class="form-group">
                                <label for="email-field">新密码</label>
                                <input class="form-control" type="text" name="email" id="email-field" value="{{ old('email', $user->email ) }}" />
                            </div>
                            <div class="form-group">
                                <label for="email-field">确认密码</label>
                                <input class="form-control" type="text" name="email" id="email-field" value="{{ old('email', $user->email ) }}" />
                            </div>

                            @include('common.error')
                            <div class="well well-sm">
                                <button type="submit" class="btn btn-primary ">保存</button>
                            </div>
                        </div>
                        </div>
                    <div role="tabpanel" class="tab-pane" id="settings">
                    </div>
                    <div role="tabpanel" class="tab-pane" id="renzhen">
                        <div class="col-md-5 col-md-offset-3">
                            <div class="panel panel-default">
                                <div class="panel-body">
                                    普通用户实名认证
                                </div>
                            </div>
                            <br/>
                            <div class="panel panel-default">
                                <div class="panel-body">
                                    达人用户实名认证
                                </div>
                            </div>
                            </div>

                        </div>
                    <br/> <br/>
                    </div>
                </div>


            </div>
        </div>
        </div>
    </div>

@endsection
@section('script')
    <script>
        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {

           // alert(e.target)  // newly activated tab
            e.relatedTarget // previous active tab
        })
    </script>
@endsection